package com.mofei.mall04_fileupload.common.util;

import javax.servlet.http.HttpServletRequest;

public class BeanUrl {
    public static String getRequestUrl(HttpServletRequest request) {
        String scheme = request.getHeader("X-Forwarded-Scheme");
        if (scheme == null) {
            scheme = request.getScheme();
        }
        return scheme + "://" + request.getRequestURL().toString().split("://")[1];
    }
}
